package com.nameless.service.impl;

import com.nameless.dao.OrderDao;
import com.nameless.service.StatisticsService;
import com.nameless.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author keluoyisi
 * @program: car-parent
 * @description:
 * @date 2023-02-28 17:29:36
 */
@Service
@SuppressWarnings("all")
public class StatisticsServiceImpl implements StatisticsService {

    @Autowired
    private OrderDao orderDao;

    @Override
    public Result incomeRecord(String yearMonth) {
        String[] split = yearMonth.split("-");
        String year = split[0];
        String month = split[1];
        System.out.println("year: "+year+"month: "+month);
        List<Map<Object, Integer>> maps = orderDao.selectTime(year,month);
        System.out.println(maps);
        return new Result(200,"成功",maps);
    }
}
